//
//  CalculateViewController.m
//  盘盈贷1.2
//
//  Created by iOS on 15/3/17.
//  Copyright (c) 2015年 iOS. All rights reserved.
//

#import "CalculateViewController.h"

@interface CalculateViewController ()
{
    UITextField *touzi;
    UITextField *qishi;
    UITextField *jiezhi;
}
@end

@implementation CalculateViewController
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        self.title = @"天盈宝计算器";
        self.view.backgroundColor = [UIColor whiteColor];
        self.navigationItem.hidesBackButton = NO;
        
        self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"投资" style:UIBarButtonItemStyleDone target:self action:@selector(fresh:)];
    }
    return self;
}
- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    CGFloat width = self.view.frame.size.width;
    CGFloat height = self.view.frame.size.height;
    UILabel *touzijine = [[UILabel alloc] initWithFrame:CGRectMake(width / 5.5, height / 5.5, 70, 20)];
    touzijine.center = CGPointMake(width/ 5.5, height/5.5);
    touzijine.text = @"投资金额";
    [self.view addSubview:touzijine];
    [touzijine release];
    
    
    touzi = [[UITextField alloc] initWithFrame:CGRectMake(width / 1.8, height / 5.5, width / 2.2, 30)];
    touzi.center = CGPointMake(width / 1.8, height / 5.5);
    //touzi.placeholder = "";
    [touzi.layer setCornerRadius:4];
    [touzi.layer setBorderWidth:0];
    touzi.textColor = [UIColor lightGrayColor];
    touzi.borderStyle = UITextBorderStyleRoundedRect;
    touzi.clearButtonMode = UITextFieldViewModeWhileEditing;
    [self.view addSubview:touzi];
    [touzi release];
    
    UILabel *touziqixian = [[UILabel alloc] initWithFrame:CGRectMake(width / 5.5, height / 3.8, 70, 20)];
    touziqixian.center = CGPointMake(width / 5.5, height / 3.8);
    touziqixian.text = @"起始日期";
    [self.view addSubview:touziqixian];
    [touziqixian release];
    
    qishi = [[UITextField alloc] initWithFrame:CGRectMake(width / 1.8, height / 3.8, width / 2.2, 30)];
    qishi.center = CGPointMake(width / 1.8, height / 3.8);
    [qishi.layer setCornerRadius:4];
    [qishi.layer setBorderWidth:0];
    qishi.textColor = [UIColor lightGrayColor];
    qishi.borderStyle = UITextBorderStyleRoundedRect;
    qishi.clearButtonMode = UITextFieldViewModeWhileEditing;
    [self.view addSubview:qishi];
    [qishi release];
    
    UILabel *nianhualilv = [[UILabel alloc] initWithFrame:CGRectMake(width / 5.5, height / 2.9, 70, 20)];
    nianhualilv.center = CGPointMake(width / 5.5, height / 2.9);
    nianhualilv.text = @"截止日期";
    [self.view addSubview:nianhualilv];
    [nianhualilv release];

    
    jiezhi = [[UITextField alloc] initWithFrame:CGRectMake(width / 1.8, height / 2.9, width / 2.2, 30)];
    jiezhi.center = CGPointMake(width / 1.8, height / 2.9);
    [jiezhi.layer setCornerRadius:4];
    [jiezhi.layer setBorderWidth:0];
    jiezhi.textColor = [UIColor lightGrayColor];
    jiezhi.borderStyle = UITextBorderStyleRoundedRect;
    jiezhi.clearButtonMode = UITextFieldViewModeWhileEditing;
    [self.view addSubview:jiezhi];
    [jiezhi release];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeSystem];
    button.frame = CGRectMake(width / 4, height / 2.25, 100, 30);
    button.center = CGPointMake(width / 4,  height / 2.25);
    button.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14];
    [button setTitle:@"计算" forState:UIControlStateNormal];
    button.backgroundColor = [UIColor redColor];
    [button setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(jisuan:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];

    
    UIButton *button1 = [UIButton buttonWithType:UIButtonTypeSystem];
    button1.frame = CGRectMake(width / 1.4, height / 2.25, 100, 30);
    button1.center = CGPointMake(width / 1.4,  height / 2.25);
    button1.titleLabel.font = [UIFont fontWithName:@"Helvetica-Bold" size:14];
    [button1 setTitle:@"重置" forState:UIControlStateNormal];
    button1.backgroundColor = [UIColor redColor];
    [button1 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [button1 addTarget:self action:@selector(chongzhi:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button1];
    
   
}
- (void)jisuan:(id)sender
{
    
}
- (void)chongzhi:(id)sender
{
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
